# (1 2) 3 (4) 5 6 7 (8) 9 10 11 12 13 14 15 (16) 17 18 19 20
# 2的次方都不是
n = int(input())
a = list(map(int, input().split()))
def check(x):
    if x & (x - 1) == 0:
        return True
    else:
        return False

cnt = 0
for i in a:
    if check(i):
        cnt += 1
print(cnt)
